package de.homelabs.moonrat.security;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import de.homelabs.moonrat.config.MoonratConfigurationManager;

@Service
public class MoonratSecurityManager {
	//logger
	static Logger logger = Logger.getLogger(MoonratSecurityManager.class);
	
	@Autowired
	private MoonratConfigurationManager mCfgManager;
	
	public boolean isDomainSupported(String domain){
		if (mCfgManager.getConfig().getSupportedDomains().contains(domain)){
			logger.debug("Domain check for domain '"+domain+"' : ok");
			return true;
		} else {
			logger.debug("Domain check for domain '"+domain+"' : false");
			return false;
		}
	}
}
